Repository navigation
Conversation
Witness data answered an index [999] by building 1,000 items for every collection, each anew: an indexed placeholder and nested loops in an upload expanded the trial fill to count^depth, and a deep indexed path in a definition ran Preview out of memory. A witness collection now answers every index with one shared item and enumerates it once.
TemplateJsonImportOptions.MaximumLength (1,000,000 characters) and MaximumValues (100,000 JSON values); more is TB9206 at the root. The export's self-check is not limited.
At most 1,000 operations; the patched definition's length, estimated per operation, stays within TemplateJsonImportOptions.MaximumLength and its depth within 64 levels; copy into its own source is refused like move. Each is TB9207 at the operation, so 23 self-copies no longer exhaust memory and a too deep result no longer throws.
TemplateCheckOptions.MaximumEntries (1,000), MaximumUnpackedSize (64 MiB), MaximumMarkupSize (8 MiB of .xml/.rels) and MaximumParagraphLength (20,000 characters). The package is read once before the engine sees it, counting what the entries really yield; exceeding a limit is TB9300 at the entry or paragraph and stops the check.
- Check recognises XML entries by content, not name, so a main part named document.bin is still within the markup and paragraph limits. - An entry that cannot be read (encrypted, unknown compression) is skipped instead of switching off every limit. - Patch writes its result compact, as the size budget counts it: indenting a deeply nested value multiplied its length. A patch longer than MaximumLength is refused; copying and removing more than 16 times MaximumLength in total is refused; a move detaches the node instead of cloning and serialising it; a string System.Text.Json cannot write (a lone surrogate) is TB9207 instead of an exception. - The witness list exposes only Count as a property, so a path cannot read SyncRoot or IsReadOnly from it.
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #302
TemplateInspector.Check,TemplateJson.PreviewandTemplateJson.Patchtake input from outside (uploads, agent definitions and patches). They now stay fast and small and report limits as problems, never as exceptions.What changes
Witness data: a collection answers every index (
lines[999]) with one shared item and enumerates it once. The trial fill in Check and Preview without data are linear in the template.Check (uploads): new
TemplateCheckOptionslimits:MaximumEntries(1,000),MaximumUnpackedSize(64 MiB),MaximumMarkupSize(8 MiB of XML) andMaximumParagraphLength(20,000 characters).Definitions:
TemplateJsonImportOptions.MaximumLength(1,000,000 characters) andMaximumValues(100,000 JSON values). Exceeding one is the new code TB9206 at"".Patch: each of these is TB9207 at the operation, never an exception:
MaximumLength(counted per operation);MaximumLength;MaximumLengthin total;copyinto its own source;A
movedetaches the node instead of cloning it.Docs:
docs/for-developers/template-builder.mdlists the limits and their defaults and asks hosts to cap raw uploads.Core: the quadratic scan of unterminated tags is a separate core issue, Linear scan for unterminated tags (quadratic marker patterns) #321. The paragraph limit bounds it for Check.
Decisions to check
Readstill returns indented parts.{{#else}}branch of{{#if @first}}are therefore no longer filled there.DataContract.CreateWitnessreturns collections as a non-genericIListthat enumerates one item (experimental API, TPLB001).Public API impact
Additive, builder only (experimental, TPLB001):
TemplateCheckOptions.Maximum*properties;TemplateJsonImportOptions.MaximumLengthandMaximumValues.Behaviour changes, builder only: Patch output formatting, witness collections. Core: none.
Verification
InputLimitTests.cs:dotnet format --verify-no-changes: clean.-p:ContinuousIntegrationBuild=true): 0 warnings.Deferred minors:
w:instrTextandw:delText(errs towards refusing);part, paragraph Ninstead of the engine'sbody, paragraph N;addthat overwrites an existing member.